/*
	The Sentinel by Copy112 & Bekka
*/

AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include('shared.lua')

ENT.CanSpawn = false

function ENT:Initialize()

	self:SetModel("models/props_junk/wood_crate001a.mdl")
	self:SetColor(0,0,0,1)
	self:PhysicsInit(SOLID_CUSTOM)
	self:SetMoveType(MOVETYPE_NONE)
	self:SetSolid(SOLID_NONE)
	self:SetPos(self:GetPos() - Vector(0,0,8) )
	self:PhysicsInitBox( Vector( -30, -30, 0 ), Vector( 30, 30, 1 ) )
	self:SetCollisionBounds( Vector( -30, -30, 0 ), Vector( 30, 30, 1 ) )
		
	if (math.random(1,20) < 2) then
		self.tree = ents.Create("prop_physics")
		self.tree:SetModel( "models/hoizz_mdl/tree.mdl" )
		self.tree:SetSolid(SOLID_NONE)
		self.tree:SetMoveType(MOVETYPE_NONE)
		self.tree:PhysicsInit(SOLID_CUSTOM)
		self.tree:SetPos(self:GetPos() - Vector(0,0,15))
		self.tree:Spawn()
		self.tree:PhysicsInitBox( Vector( -30, -30, 0 ), Vector( 30, 30, 128 ) )
		self.tree:SetCollisionBounds( Vector( -30, -30, 0 ), Vector( 30, 30, 128 ) )
	end
	
end
